package com.tuanzi.loan.web.lazy.product.product;

import com.tuanzi.loan.business.service.product.product.LoanProductInfoService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.product.product.LoanProductInfoSearchRequest;
import com.tuanzi.loan.vo.response.product.product.LoanProductInfoSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class LoanProductInfoLazyDataModel extends LazyDataSessionModel<LoanProductInfoSearchRequest, LoanProductInfoSearchResponse> {

	private static final long serialVersionUID = 9143007553234885156L;

	private LoanProductInfoService loanProductInfoService;

	public LoanProductInfoLazyDataModel(LoanProductInfoSearchRequest searchRequest, CurrentUserBean session, LoanProductInfoService loanProductInfoService) {
		super(searchRequest, session);
		this.loanProductInfoService = loanProductInfoService;
	}

	@Override
	protected Page<LoanProductInfoSearchResponse> doLoad0(PageSearcher<LoanProductInfoSearchRequest> pageSearcher) {
		return loanProductInfoService.list(pageSearcher);
	}
}
